﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DoQues.aspx.cs" Inherits="CSM.Views.Wenjuan.DoQues" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <script type="text/javascript" src="../../Js/jquery-1.3.2.min.js"></script>

    <script type="text/javascript" src="../../Js/jquery-ui-1.7.1.custom.min.js"></script>

    <script src="../../Js/jquery.autocomplete.min.js" type="text/javascript"></script>

    <link href="../../App_Themes/Default_1/jquery.autocomplete.css" type="text/css" rel="stylesheet" />
    <style type="text/css">
        body
        {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 16px;
            margin-top: 10px;
        }
        ul
        {
            margin: 0;
        }
        #contentWrap
        {
            width: 700px;
            margin: 0 auto;
            height: auto;
            overflow: hidden;
        }
        #contentTop
        {
            width: 600px;
            padding: 10px;
            margin-left: 30px;
        }
        #contentLeft
        {
            float: left;
            width: 400px;
        }
        #contentLeft li
        {
            list-style: none;
            margin: 0 0 4px 0;
            padding: 10px;
            background-color: #f2f2f2;
            border: #CCCCCC solid 1px;
            color: black;
        }
        #contentRight
        {
          
            width: 400px;
            padding: 1px;
            background-color: #ffffff;
        }
    </style>

    <script type="text/javascript">
        $(document).ready(function() {
            $(function() {
                $("#txtUser").autocomplete("../Management/GetData.ashx?database=TCrm_KF_Order&which=OrderID");
                $("#contentLeft ul").sortable({ opacity: 0.6, cursor: 'move', update: function() {
                    var order = $(this).sortable("serialize");
                    $("#orderstring").val(order);
                }
                });
            });

        });
        function lefttoright() {
            var checks = document.getElementsByTagName("input");
            var count = checks.length;
            var queryarray = new Array();
            var query2 = new Array();
            var str = "";
            var i = 0;
            for (var n = 0; n < count; n++) {
                if (checks[n].type == 'checkbox') {
                    if (checks[n].checked == true) {
                        queryarray[i] = checks[n].value;
                        query2[i] = checks[n].title;
                        i += 1;
                        str += "<li id=recordsArray_" + checks[n].value + ">" + checks[n].title + "</li>";
                    }
                }
            }
            $("#temp").append(str);
            togglethis();

        }
        function togglethis() {
            $("#ahide").toggle();
        };
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="ahide" style="position: fixed; display: none; overflow: hidden; right: 50px; background-color: #CCCCCC; width:400px"
        align="center">
        <asp:ScriptManager ID="ScriptManager2" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Label ID="Label3" runat="server" Text="题目标题"></asp:Label>
                <asp:TextBox ID="txtUser" runat="server"></asp:TextBox>
                <asp:Button ID="Button_Browse" runat="server" Text="查询" SkinID="Button" OnClick="Button_Browse_Click" /><br />
                <asp:LinkButton ID="LinkButton_First" runat="server" CommandArgument="First" OnClick="MyClick"><img src = "../../App_Themes/Default_1/Images/Page_First.gif" class = "Page_First"alt = "首页" /></asp:LinkButton>
                <asp:LinkButton ID="LinkButton_Prev" runat="server" CommandArgument="Prev" OnClick="MyClick"><img  src = "../../App_Themes/Default_1/Images/Page_Prev.gif" class = "Page_Prev"  alt = "上页"/></asp:LinkButton>
                <asp:LinkButton ID="LinkButton_Next" runat="server" CommandArgument="Next" OnClick="MyClick"><img  src = "../../App_Themes/Default_1/Images/Page_Next.gif"  class = "Page_Next"  alt = "下页"/></asp:LinkButton>
                <asp:LinkButton ID="LinkButton_Last" runat="server" CommandArgument="Last" OnClick="MyClick"><img   src = "../../App_Themes/Default_1/Images/Page_Last.gif" class = "Page_Last" alt = "末页"/></asp:LinkButton>
                <asp:Label ID="Label_Total" runat="server" SkinID="Label" Text="共："></asp:Label>
                <asp:Label ID="Label_CurrenPageAndTo" runat="server" SkinID="Label" Text="页，当前第 页，转到"></asp:Label>
                <asp:TextBox ID="TextBox_PageIndex" runat="server" Width="26px"></asp:TextBox>
                <asp:Label ID="Label4" runat="server" SkinID="Label" Text="页"></asp:Label>
                <asp:RangeValidator ID="RangeValidator_PageIndex" runat="server" ControlToValidate="TextBox_PageIndex"
                    ErrorMessage="*" MaximumValue="10000" MinimumValue="1" Type="Integer"></asp:RangeValidator>
                <asp:Button ID="Button_PageGo" runat="server" CommandArgument="GotoPage" OnClick="MyClick"
                    SkinID="Button" Text="GO" />
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" SkinID="gridview"
                    BorderColor="White">
                    <Columns>
                        <asp:BoundField DataField="QuestionID" HeaderText="题目ID" ReadOnly="True" SortExpression="题目ID" />
                        <asp:BoundField DataField="Qtype" HeaderText="题目类型" ReadOnly="True" SortExpression="题目类型" />
                        <asp:BoundField DataField="Title" HeaderText="题目内容" ReadOnly="True" SortExpression="题目内容" />
                        <asp:TemplateField>
                            <ItemTemplate>
                                <input id="Checkbox1" type="checkbox" value='<%# Eval("QuestionID") %>' title='<%# Eval("Title") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <asp:Button ID="Button1" runat="server" Text="添加" OnClientClick="lefttoright();return false;"
                    SkinID="Button" />
                <asp:HiddenField ID="CurrentPage" runat="server" Value="0" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>

        
    <div id="contentWrap">
     <div id="contentRight">
            <asp:Label ID="Label1" runat="server" Text="问卷ID：" SkinID="Label"></asp:Label>
            <asp:TextBox ID="TextBox_ID" runat="server" SkinID="TextBox"></asp:TextBox>
            <asp:Label ID="Label2" runat="server" Text="问卷名称："  SkinID="Label"></asp:Label>
            <asp:TextBox ID="TextBox_Name" runat="server" SkinID="TextBox"></asp:TextBox>
            <asp:Button ID="Button_Submit" runat="server" Text="确定" SkinID="Button" OnClick="Button_Submit_Click" />
        </div>
            <asp:Button ID="Button_toggle" runat="server" Text="选择题目" SkinID="Button" onclientclick="togglethis();return false;" />
        <div id="contentTop">
        </div>
        <div id="contentLeft">
            <ul id="temp" runat="server">
                <li id="recordsArray_begin" style="background-color: #ffffff" >问卷开始</li>
                <li id="recordsArray_end" style="background-color: #ffffff">问卷结束</li>
            </ul>
        </div>
       
    </div>
    <asp:HiddenField ID="orderstring" runat="server" Value="" />
    </form>
</body>
</html>
